package com.jsb.laundry.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jsb.laundry.model.dto.posts.PostUserFansQueryRequest;
import com.jsb.laundry.model.dto.posts.PostUserFollowQueryRequest;
import com.jsb.laundry.model.entity.JsbPostUserFollowers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jsb.laundry.model.entity.JsbPosts;
import com.jsb.laundry.model.entity.UserDetail;
import com.jsb.laundry.model.vo.PostsUserFollowersVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author ching
* @description 针对表【jsb_post_user_followers(帖子用户关注关系的表)】的数据库操作Service
* @createDate 2023-08-15 11:52:11
*/
public interface JsbPostUserFollowersService extends IService<JsbPostUserFollowers> {

    /**
     * 关注
     *
     * @param userId
     * @param followerId
     * @return
     */
    int doPostUserFollow(String userId, String followerId);

    /**
     * 关注（内部服务）
     *
     * @param userId
     * @param followerId
     * @return
     */
    int doPostUserFollowInner(String userId, String followerId);

    /**
     * 分页获取关注的用户列表
     *
     * @param postUserFollowers
     * @param request
     * @return
     */
    Page<PostsUserFollowersVO> listUserFollowVOPage(String userId, Page<UserDetail> postUserFollowers, HttpServletRequest request);

    /**
     * 分页获取用户的粉丝列表
     *
     * @param postUserFollowers
     * @param request
     * @return
     */
    Page<PostsUserFollowersVO> listUserFansVOPage(String userId, Page<UserDetail> postUserFollowers, HttpServletRequest request);

    /**
     * 分页获取用户关注的人的帖子列表
     *
     * @param page
     * @param queryWrapper
     * @param userId
     * @return
     */
    Page<JsbPosts> listFollowPostByPage(IPage<JsbPosts> page, Wrapper<JsbPosts> queryWrapper, String userId);
}
